<?php 
echo $_SERVER['PHP_SELF'];
echo "<br>";
echo $_SERVER['SERVER_NAME'];
echo "<br>";
echo $_SERVER['HTTP_HOST'];
echo "<br>"; 
echo $_SERVER['HTTP_USER_AGENT'];
echo "<br>";
echo $_SERVER['SCRIPT_NAME'];

$domain = $_SERVER['SERVER_NAME'];
$mirror = "www.mz.cn";
switch ($domain)
{
case "www.a.cn":
  $mirror = "www.az.cn";
  break;
case "www.b.com.cn":
  $mirror = "www.bz.com";
  break;
default:
  $mirror = "www.mz.cn";
}

$req = $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . " HTTP/1.0\r\n";

echo "<br>";
echo '域名' . $domain ;
echo "<br>";
echo '镜像$mirror ' . $mirror  ;
echo "<br>";
echo '请求$req ' . $req ;
echo "<br>";
echo 'uri 网址 ' . $_SERVER['REQUEST_URI'] ;
echo "<br>";

$uri = $_SERVER['REQUEST_URI'] ; 
// http://php.ap.com/tx/https://www.baidu.com/baidu?wd=hello
echo '<br>提取的网址为 ' . substr($uri,4);

//$dst = substr($uri,4);
//header('Location: http://www.mzyq.com/');
//header('Location: ' . $dst );
?>